package com.egreen.asset.controller;


import com.egreen.asset.service.IOperatePointRecordingService;
import com.egreen.common.Result;
import com.egreen.common.pojo.VO.asset.OperatePointRecordingVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author cloudJiang
 * @since 2022-07-16
 */
@RestController
@RequestMapping("/operatePointRecording")
public class OperatePointRecordingController {
    @Autowired
    IOperatePointRecordingService operatePointRecordingService;


/*    *//**
     * 积分增加与减少
     *
     * @param operatePointRecordingDTO
     *//*
    @ApiOperation(value = "积分操作",notes = "通过updatePoint方法来操作积分")
    @PostMapping("/updatePoint")
    public Result updatePoint(@RequestBody OperatePointRecordingDTO operatePointRecordingDTO) {
        operatePointRecordingService.updateByPoint(operatePointRecordingDTO);
        return Result.OK();
    }*/

    /**
     * 积分交易明细查看(需要从前端传过来id来显示其交易记录)
     * get请求注解用@PathVariable 传值在url上显示
     *
     * @param pointAccountId
     * @return
     */
    @ApiOperation(value = "积分交易明细查看", notes = "查看积分交易明细")
    @GetMapping("/PointRecording")
    public Result PointRecording(@RequestParam Long pointAccountId) {
        List<OperatePointRecordingVO> operatePointRecordingVOS = operatePointRecordingService.selectPointById(pointAccountId);
        return Result.OK(operatePointRecordingVOS);
    }

}

